package com.aaa.daydemo111.demo2;

/**
 * @Description:
 * @author:LiWei
 * @date:2022年11月01日9:31
 */
public class TestPriority {
    public static void main(String[] args) {
        PriorityDemo p1 = new PriorityDemo();
        PriorityDemo p2 = new PriorityDemo();
        PriorityDemo p3 = new PriorityDemo();

        p1.setPriority(1);
        p2.setPriority(5);
        p3.setPriority(10);

        p1.start();
        p2.start();
        p3.start();
    }
}
class PriorityDemo extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println(Thread.currentThread().getName()+"===="+i);
        }
    }
}